﻿using EchoWx.Models;
using EchoWx.Models.DtoModel.Identity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EchoWx.IService
{
    public interface IWxIdentityService
    {
        /// <summary>
        /// 根据前台传递的code，加密数据，iv等授权登录
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<BaseResponse<AccountView>> Login(AccountLoginDto dto);
        /// <summary>
        /// 根据Code获取SessionKey和OpenId
        /// </summary>
        /// <returns></returns>
        Task<BaseResponse<WxValidateUserResponse>> GetSessionKeyAndOpenId(string code);
        /// <summary>
        /// 根据iv和sessionKey解密encryptedData
        /// </summary>
        /// <param name="iv"></param>
        /// <param name="encryptedData">加密的数据</param>
        /// <returns></returns>
        Task<BaseResponse<WxResponseUserInfo>> DecryptWxUserData(WxValidateUserResponse vModel,string iv,string encryptedData);
    }
}
